package Chapter02.Homework;

public class Work04 {
    public static void main(String[] args) {
        StringBuffer st=new StringBuffer("小方");
        long time=System.currentTimeMillis();
        for (int i=0;i<100000;i++){
            st.append("好");
        }
        long time2=System.currentTimeMillis();
        System.out.println("StrBuffer用时："+(time2-time));
        StringBuilder str=new StringBuilder("小明");
        long time3=System.currentTimeMillis();
        for (int i=0;i<100000;i++){
            st.append("好");
        }
        long time4=System.currentTimeMillis();
        System.out.println("Stringbulider用时："+(time4-time3));
    }
}
